package com.leal.client

import com.leal.util.SparkUtil
import org.apache.log4j.Logger
import org.apache.spark.sql.SparkSession

/**
 * @Classname bigdata
 * @Description 检查一些配置是否正确
 * @Date 2024/12/24 17:35
 * @Created by leal
 */
object Hello {
  val logger: Logger = Logger.getLogger(this.getClass)

  def main(args: Array[String]): Unit = {

    // 判断collection.Map 是否可序列化
    val map: collection.Map[String, String] = Map("a" -> "b")
    println(map)
    println(map.isInstanceOf[Serializable])
    // master = "spark://master:7077",
    val spark: SparkSession = SparkUtil.initSpark( enableHive = true)
    logger.info(s"创建spark $spark")
    spark.sql("show databases")
    spark.sql(
      """
        |    spark.sql("insert into test_split values (1001,"a||b||cc"),(1002,"we||fgds||dfgfg");")
        |
        |
        |""".stripMargin)

    spark.stop()
  }
}
